<?php

class User{

  /**
   * @var User_Model_User
   */
  protected static $_currentUser;

  /**
   * @return User_Model_User
   */
  public static function current() {
    if (self::$_currentUser == NULL) {
      self::$_currentUser = self::_getCurrentUser();
    }
    return self::$_currentUser;
  }

  /**
   * @return User_Model_User
   */
  protected static function _getCurrentUser() {
    $model = new User_Model_DbTable_Users();
    return $model->fetchRow();
  }

}
